import request from '@/utils/request'

// 企业物流编码表分页查询
export function pageExpress(query) {
  return request({
    url: '/user/enterpriseExpress/paging',
    method: 'get',
    params: query
  })
}

// 企业物流编码表分页查询
export function listExpress(query) {
  return request({
    url: '/user/enterpriseExpress/list',
    method: 'get',
    params: query
  })
}

// 系统物流编码表分页查询
export function pageSystemExpress(query) {
  return request({
    url: '/user/enterpriseExpress/pageSystemExpress',
    method: 'get',
    params: query
  })
}

// 新增或更新企业物流编码表
export function saveExpress(express) {
  return request({
    url: '/user/enterpriseExpress/save',
    method: 'post',
    data: express
  })
}

// 从系统物流编码新增企业物流编码表
export function saveSysExpress(enterpriseId, sysExpressIds, supplierId) {
  return request({
    url: '/user/enterpriseExpress/saveSysExpress',
    method: 'post',
    params: { enterpriseId, sysExpressIds, supplierId }
  })
}

// 新增或更新企业物流配置
export function saveEnterpriseExpressConfig(config) {
  return request({
    url: '/user/enterpriseExpressConfig/save',
    method: 'post',
    data: config
  })
}
// 获取企业物流配置
export function getEnterpriseExpressConfig(enterpriseId, supplierId) {
  return request({
    url: '/user/enterpriseExpressConfig/getByEnterpriseId',
    method: 'get',
    params: { enterpriseId, supplierId }
  })
}

// 批量设置
export function batchEnableExpress(expressIds) {
  return request({
    url: '/user/enterpriseExpress/batchEnableExpress',
    method: 'post',
    params: { expressIds }
  })
}

// 批量设置
export function batchDisableExpress(expressIds) {
  return request({
    url: '/user/enterpriseExpress/batchDisableExpress',
    method: 'post',
    params: { expressIds }
  })
}

// 批量设置
export function batchDeleteExpress(expressIds) {
  return request({
    url: '/user/enterpriseExpress/batchDeleteExpress',
    method: 'post',
    params: { expressIds }
  })
}

// 设置标准面单模板
export function saveStandardFaceSheet(data) {
  return request({
    url: '/user/enterpriseExpress/saveStandardFaceSheetTemplate',
    method: 'post',
    data: data
  })
}

